﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
using Chinaer.DTO;
using System.ComponentModel;

namespace Chinaer.WCF.Contracts
{
    /// <summary>
    /// 菜单类别的操作类
    /// </summary>
    public partial interface IChinaer
    {
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetAllMenuCategory")]
        [Description("获取所有的菜单类别")]
        List<DTO.MenuCategoryDTO> GetAllMenuCategory();

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "AddMenuCategory")]
        [Description("添加一个菜单类别")]
        Chinaer.Model.Common.JsonResult AddMenuCategory(MenuCategoryDTO menuCategoryDTO);

        [OperationContract]
        [WebInvoke(Method = "GET",
            BodyStyle = WebMessageBodyStyle.Bare,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteMenuCategoryByID/{menuCategoryID}/{apiToken}")]
        [Description("根据菜单类别编号删除菜单类别")]
        Chinaer.Model.Common.JsonResult DeleteMenuCategoryByID(string menuCategoryID, string apiToken);

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteMenuCategory")]
        [Description("删除菜单类别")]
        Chinaer.Model.Common.JsonResult DeleteMenuCategory(MenuCategoryDTO menuCategoryDTO);

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateMenuCategory")]
        [Description("更新菜单类别信息")]
        Chinaer.Model.Common.JsonResult UpdateMenuCategory(MenuCategoryDTO menuCategoryDTO);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
           BodyStyle = WebMessageBodyStyle.Bare,
           UriTemplate = "GetMenucategoryByName/{menucategoryName}/{apiToken}"
             )]
        [Description("根据名称获取MenucategoryDTO")]
        DTO.MenuCategoryDTO GetMenucategoryByName(string menucategoryName,string apiToken);
    }
}
